## Compiling Instructions

> This page is designed to help people trying to compile emuWorks software on the three supported platforms: Windows, Linux, and Mac OS X. Windows prior to 2000 and Mac OS X prior to Tiger are not officially supported. Our software may or may not work on these older systems. PPC Macs with Tiger or later are supported.

> There are two GUI toolkits used by emuWorks programs: Qt and wxWidgets. To compile our software, you will need to have the correct toolkit installed. We use Java for a couple programs, but C++ versions of these programs are also available and recommended. If you want to use the applet versions, they are available in their sections.

> Qt is needed for the C++ version of the Game Genie Encoder/Decoder, as well as the Legend of Zelda (NES) and Secret of Evermore (SNES) SRAM Editors.

> wxWidgets is used for the C++ version of the SNES CHT Decoder and the Metroid (NES) password generator. It is also used for the Dragon Warrior (NES), Final Fantasy (NES), Super Metroid (SNES), Ultima: Quest of the Avatar (NES), and Legend of Zelda II (NES) SRAM Editors.

Instructions for
[ Windows Linux Mac OS X ]

### Windows Development Environment Instructions

> Windows is a complicated development environment. This is mainly because there are so many options for compiling under Windows. I will provide instructions for using Visual Studio 2008 or msys with mingw. I am not providing instructions for installing either of these programs. For that please consult their respective websites.

> The first thing to do is determine which toolkit you will need to compile the program you want. The list of programs and their required toolkit is available at the top of this page.

> Compiling Qt with Visual Studio
> Compiling Qt with mingw
> Compiling wxWidgets with Visual Studio
> Compiling wxWidgets with msys/mingw

#### Compiling Qt with Visual Studio

> Download the Qt Windows open source edition from their website. Do not get the mingw executable. Extract the archive (qt-win-opensource-src-4.4.3.zip) to c:\.

> The opensource version of Qt for Windows does not support Visual Studio IDE integration, so we must use the command line tools. On the Start Menu under Microsoft Visual C++/Visual Studio Tools is a Visual Studio Command Prompt. You will need to start this. Enter the following commands.

>     C:\> cd\qt-win-opensource-4.4.3
>     C:\qt-win-opensource-4.4.3> configure -release -fast -no-qt3support
>     C:\qt-win-opensource-4.4.3> nmake

> If that went well, you should now have a working Qt installation. The release option tells it not to build a debug version, and the no-qt3support option tells it not to build the Qt3 support library. The fast option speeds up configure by delaying Makefile creation.

> For Windows to find your new Qt libraries, you will need to add them to your system path. On Vista, open Computer, click on System Properties, and then Advanced System Properties. Click the Environment Variables Button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\qt-win-opensource-src-4.4.3\bin' to the string. Do not remove or change anything that is already in the string. On XP, open Control Panel then System. Select the Advanced tab and click the Environment Variables button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\qt-win-opensource-src-4.4.3\bin' to the string. Do not remove or change anything that is already in the string.

#### Compiling with Qt under Visual Studio

> Compiling emuWorks software with Qt involves using the qmake tool. So that will need to be in our path. We'll use the Legend of Zelda (NES) SRAM editor as an example. Download the source and extract it on your desktop. If you don't have a program to open .tar.bz2 files, you'll need to get one. I suggest 7-zip. Open the Visual Studio command prompt and enter the following commands.

>     C:\> cd %USERPROFILE%/Desktop/lozsrame-0.90a/source
>     C:\Users\username\Desktop\lozsrame-0.90a\source> qmake
>     C:\Users\username\Desktop\lozsrame-0.90a\source> nmake Release

> If all went well, you should now have a lozsrame.exe executable in your lozsrame-0.90a\source\release directory. You can adapt these instructions to other emuWorks Qt software.

#### Compiling Qt with mingw

> Download the Qt Windows open source edition from their website. I suggest not getting the mingw executable and rather compile it yourself. Extract the archive (qt-win-opensource-src-4.4.3.zip) to c:\. Start a command prompt and enter the following.

>     C:\> cd\qt-win-opensource-src-4.4.3
>     C:\qt-win-opensource-src-4.4.3> configure -release -fast -no-qt3support
>     C:\qt-win-opensource-src-4.4.3> mingw32-make Release

> Assuming that went well, you should now have a Qt installation. The release option tells it not to build the debug version while the no-qt3support option tells it not to build the Qt3 support library. The fast option makes configure run faster by delaying Makefile generation.

> For Windows to find your new Qt libraries, you will need to add them to your system path. On Vista, open Computer, click on System Properties, and then Advanced System Properties. Click the Environment Variables Button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\qt-win-opensource-src-4.4.3\bin' to the string. Do not remove or change anything that is already in the string. On XP, open Control Panel then System. Select the Advanced tab and click the Environment Variables button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\qt-win-opensource-src-4.4.3\bin' to the string. Do not remove or change anything that is already in the string.

#### Compiling with Qt under mingw

> Compiling emuWorks software with Qt involves using the qmake tool. So that will need to be in our path. We'll use the Legend of Zelda (NES) SRAM editor as an example. Download the source and extract it on your desktop. If you don't have a program to open .tar.bz2 files, you'll need to get one. I suggest 7-zip. Open a command prompt and enter the following commands.

>     C:\> cd %USERPROFILE%/Desktop/lozsrame-0.90a/source
>     C:\Users\username\Desktop\lozsrame-0.90a\source> qmake
>     C:\Users\username\Desktop\lozsrame-0.90a\source> mingw32-make

> If all went well, you should now have a lozsrame.exe executable in your lozsrame-0.90a\source directory. You can adapt these instructions to other emuWorks Qt software.

#### Compiling wxWidgets with Visual Studio

> Download wxWidgets from their website. The current version is 2.8.9. I suggest you get the Windows installer. After running the installer, you will have a c:\wxWidgets-2.8.9 directory with the source.

> To build the library, you need to open the Visual Studio project file. That file is called c:\wxWidgets-2.8.9\build\msw\wx.dsw. When you open that file in Visual Studio, it will ask if you want to convert the project files. Say yes to all. When that is done, select 'DLL Unicode Release' from the configuration manager. Finally, select Build Solution from the Build menu. This step will need to be repeated several times. Just keep doing it until there are no errors. There is a problem with the dependency tree.

> To let Visual Studio know where wxWidgets is, we need to add some directories to its search path. Select Options from the Tools menu. Go to 'Projects and Solutions' and VC++ Directories. Select 'Include files' from 'Show directories for:'. You need to add two directories here. The first one is c:\wxWidgets-2.8.9\include. The second one is c:\wxWidgets-2.8.9\lib\vc_dll\mswu. Now change 'Include files' to 'Library files' and add the folder c:\wxWidgets-2.8.9\lib\vc_dll.

> For Windows to find your new wxWidgets libraries, you will need to add them to your system path. On Vista, open Computer, click on System Properties, and then Advanced System Properties. Click the Environment Variables Button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\wxWidgets-2.8.9\lib\vc_dll' to the string. Do not remove or change anything that is already in the string. On XP, open Control Panel, then System. Select the Advanced tab and click the Environment Variables button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\wxWidgets-2.8.9\lib\vc_dll' to the string. Do not remove or change anything that is already in the string.

#### Compiling with wxWidgets under Visual Studio

> Now that we have the wxWidgets library compiled, we can compile emuWorks wxWidgets based software. For this example, we'll use the SNES CHT Decoder program. Download the source and extract it on your desktop.

> Inside the extracted directory, you will find a folder called vstudio. Within that folder is a .sln solution file. Open that file in Visual Studio and select 'DLL Unicode Release' from the configuration manager. Next select Build Solution from the Build menu. In a few minutes, you should have your wxchtdecoder.exe binary.

#### Compiling wxWidgets with mingw/msys

> Download wxWidgets from their website. I suggest getting the installer. The current version is 2.8.9. After running the installer, you will have the source in c:\wxWidgets-2.8.9. Start msys and enter the following commands.

>     user@localhost $ mkdir build-wx ; cd build-wx
>     user@localhost $ /c/wxWidgets-2.8.9/configure --disable-compat26 --enable-unicode
>     user@localhost $ make && make install

> Assuming there were no problems, you should now have a wxWidgets installation in ~/wx/2.8.9. The disable-compat26 option is used to disable wxWidgets 2.6 compatibility and enable-unicode adds support for unicode.

> For Windows to find your new wxWidgets libraries, you will need to add them to your system path. On Vista, open Computer, click on System Properties, and then Advanced System Properties. Click the Environment Variables Button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\msys\1.0\local\lib' to the string. Do not remove or change anything that is already in the string. On XP, open Control Panel then System. Select the Advanced tab and click the Environment Variables button. Look for the Path variable in 'System Variables'. Highlight it and click edit. Append ';c:\msys\1.0\local\lib' to the string. Do not remove or change anything that is already in the string.

#### Compiling with wxWidgets under mingw/msys

> Building emuWorks software with wxWidgets under msys is pretty easy due to the GNU autotools build system. We just need to make sure configure can find wxWidgets. For this example, we'll compile the wxCHTDecoder program. Download the source to your msys home directory and start msys. Enter the following commands.

>     user@localhost $ bzip2 -cd ~/wxCHTDecoder-1.5a.tar.bz2 | tar x
>     user@localhost $ cd wxCHTDecoder-1.5a
>     user@localhost $ ./configure && make

> If all went well, you should now have a wxchtdecoder.exe binary in your ~/wxCHTDecoder-1.5a/source directory.

### Linux Development Environment Instructions

> Linux is fairly straightforward when is comes to development. g++ is the preferred C++ compiler and often comes standard with your installation. Because I use gentoo linux, I have provided some gentoo-specific hints, but there will also be distribution-neutral instructions. To see if you have g++ installed, start a terminal and run the following command:

>     user@localhost $ g++ --version
>     g++ (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)
>     Copyright (C) 2006 Free Software Foundation, Inc.
>     This is free software; see the source for copying conditions.  There is NO
>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> Your output should be similar, but probably not identical to mine. Any g++ version 3.3 or later *should* work, but I haven't used anything older than 3.4.5 in a long time. If you get something like 'command not found', you probably don't have g++ installed. You will have to consult your linux documentation for how to install gcc/g++.

> Depending upon what program you want to build, you will need to install the correct GUI toolkit. The list of programs and their required toolkit is available at the top of this page.

> Linux Qt Setup Instructions
> Linux wxWidgets Setup Instructions

#### Linux Qt Setup

> If you are using gentoo linux, you can use 'emerge qt:4' as root to install the Qt4 library. If you are using a different linux, follow the directions below or see if your distribution has a Qt4 development package you can install (highly recommended). Skip to compiling with Qt under Linux if you have installed a development package.

> Qt is very easy to configure and install. Download the open source X11 edition from their website. The current version is 4.4.3. Save the file (qt-x11-opensource-src-4.4.3.tar.gz) to your Desktop. Start a terminal and enter the following commands.

>     user@localhost $ cd /tmp
>     user@localhost $ gzip -cd ~/Desktop/qt-x11-opensource-src-4.4.3.tar.gz | tar x
>     user@localhost $ cd qt-x11-opensource-src-4.4.3
>     user@localhost $ ./configure -release -fast -no-qt3support -nomake demos -nomake examples
>     user@localhost $ make && sudo make install

> sudo is not installed on gentoo by default, so if you don't have it, you may need to use su to be come root first, then run make install. The options passed to configure are time savers. No emuWorks programs require the Qt3 support library, and it takes forever to compile all the demos and examples Qt comes with. If all went well, you should now have the Qt4 toolkit installed.

#### Compiling with Qt under Linux

> Compiling emuWorks software with Qt uses the Qt tool qmake. We will use the Game Genie Encoder/Decoder for an example. Download the source to your Desktop folder. Start a terminal and enter the following.

>     user@localhost $ cd /tmp
>     user@localhost $ bzip2 -cd ~/Desktop/ggencoder-0.91a.tar.bz2 | tar x
>     user@localhost $ cd ggencoder-0.91a/source
>     user@localhost $ qmake && make

> The ggencoder binary will be in the /tmp/ggencoder-0.91a/source directory. You should be able to adapt this to all emuWorks Qt software.

#### Linux wxWidgets Setup

> If you are running gentoo linux, you can use 'emerge wxGTK' to install wxWidgets. If you are using a different linux, follow the directions below or see if your distribution has a wxWidgets development package (highly recommended). Skip to compiling with wxWidgets under Linux if you installed a development package.

> wxWidgets installation can seem complicated because there are several options, but it is not as difficult as it seems. First, you will need to have the GTK+ 2 libraries installed on your system. These are nearly ubiquitous on linux regardless of your desktop environment because so many programs use them. Download wxGTK from their website. The current version is 2.8.9. Save the archive (wxGTK-2.8.9.tar.gz) on your Desktop. Start a terminal and enter the following commands.

>     user@localhost $ cd /tmp
>     user@localhost $ gzip -cd ~/Desktop/wxGTK-2.8.9.tar.gz | tar x
>     user@localhost $ mkdir build-wx ; cd build-wx
>     user@localhost $ ../wxGTK-2.8.9/configure --enable-unicode --disable-compat26
>     user@localhost $ make && make install

> The enable-unicode option adds unicode support while the disable-compat26 option disables wxWidgets 2.6 compatibility. If all went well, you now have wxWidgets installed.

#### Compiling with wxWidgets under Linux

> Building emuWorks software with wxWidgets is easy because all our wxWidgets-based programs use GNU autotools. For this example, we'll use the Dragon Warrior SRAM editor. Download the source to your Desktop and start a terminal.

>     user@localhost $ cd /tmp
>     user@localhost $ bzip2 -cd ~/Desktop/dwsrame-0.91a.tar.bz2 | tar x
>     user@localhost $ cd dwsrame-0.91a
>     user@localhost $ ./configure --prefix $HOME/emuWorks
>     user@localhost $ make && make install

> If all went well, you should now have a dwsrame binary in the ~/emuWorks/bin directory. The prefix argument tells make to install the program in your home directory under ~/emuWorks. You should be able to adapt these directions to other emuWorks programs as needed.

### Mac OS X Development Environment Instructions

> Mac OS X has UNIX-like underpinnings, so building on a Mac is very similar to building on any UNIX system. But first you have to install the right tools.

> The first thing you need is the development tools, which on OS X are called Xcode. Go to the apple webiste or google and search for Xcode. You will need to register to download it. On Tiger, you need Xcode 2.5. On Leopard, you can use Xcode 3. Since I don't have Leopard, I will be using Xcode 2.5 (xcode25_8m2558_developerdvd.dmg). When you get the package, open it and run the installer program. I can't remember all the options off the top of my head, but you will need the BSD Developer subsystem and the command line tools.

> Depending upon what program you want to build, you will need to install the correct GUI toolkit. The list of programs and their required toolkit is available at the top of this page.

> Mac OS X Qt Setup Instructions
> Mac OS X wxWidgets Setup Instructions

#### Mac OS X Qt Setup Instructions

> Setting up Qt isn't too bad on OS X. First download the Qt Mac open source edition from their website. The current version is 4.4.3. Save the file (qt-mac-opensource-src-4.4.3.tar.gz) on your Desktop. Start Terminal and enter the following commands.

>     user@localhost $ cd /tmp
>     user@localhost $ gzip -cd ~/Desktop/qt-mac-opensource-src-4.4.3.tar.gz | tar x
>     user@localhost $ cd qt-mac-opensource-src-4.4.3
>     user@localhost $ ./configure -prefix /Developer/qt/4.4.3 -release -fast -no-qt3support -nomake demos -nomake examples
>     user@localhost $ make
>     user@localhost $ sudo make install

> The prefix option tells Qt to install in the /Developer directory under qt/4.4.3. The release option tells it not to build a debug version of the library. The no-qt3support option disables the Qt3 support library which is not used by any emuWorks programs. The two nomake options tell it not to build the Qt demos or examples. Finally, the fast option speeds up configure by delaying Makefile creation. If all went well, you now have the Qt toolkit installed.

#### Compiling with Qt under Mac OS X

> Compiling emuWorks software with Qt involves using the qmake tool. We will use the Secret of Evermore (SNES) SRAM Editor for an example. Download the source to your Desktop. Start Terminal and enter the following commands.

>     user@localhost $ export PATH=/Developer/qt/4.4.3/bin:$PATH
>     user@localhost $ cd /tmp
>     user@localhost $ bzip2 -cd ~/Desktop/soesrame-0.91a.tar.bz2 | tar x
>     user@localhost $ cd soesrame-0.91a/source
>     user@localhost $ qmake && make

> If all went well, you now have a soesrame.app bundle in the /tmp/soesrame-0.91a/source directory. You can adapt these directions for other emuWorks Qt programs.

#### Mac OS X wxWidgets Setup Instructions

> The first thing to do is download the wxWidgets Mac edition from their website. The current version is 2.8.9. Save the file (wxMac-2.8.9.tar.gz) on your Desktop. Start Terminal and enter the following commands.

>     user@localhost $ cd /tmp
>     user@localhost $ gzip -cd ~/Desktop/wxMac-2.8.9.tar.gz | tar x
>     user@localhost $ mkdir build-wx ; cd build-wx
>     user@localhost $ ../wxMac-2.8.9/configure --prefix /Developer/wx/2.8.9 --disable-compat26 --enable-unicode
>     user@localhost $ make
>     user@localhost $ sudo make install

> If all went well, you now have a current wxWidgets installation in your home directory. The prefix option was to setup the installation path. The disable-compat26 option tells it not to enable wxWidgets 2.6 compatibility and the enable-unicode option tells it to build wxWidgets with unicode support.

#### Compiling with wxWidgets under Mac OS X

> Now that we have a wxWidgets installation, we can use it to compile emuWorks software. We'll use Metroid (NES) Password generator as an example. Download the source to your Desktop. Start Terminal and enter the following commands.

>     user@localhost $ export PATH=/Developer/wx/2.8.9/bin:$PATH
>     user@localhost $ cd /tmp
>     user@localhost $ bzip2 -cd ~/Desktop/mpg-1.0a.tar.bz2 | tar x
>     user@localhost $ cd mpg-1.0a
>     user@localhost $ ./configure && make bundle

> You should now have a mpg.app bundle in the /tmp/mpg-1.0a/source directory.

### Conclusions

> Compiling software can be difficult. These instructions are by no means exhaustive and you may run into programs. Please feel free to contact me if you have any trouble building any emuWorks program.

Need to contact us? We can be reached by email or via our online feedback form.

##### Copyright © 2004-2008 emuWorks
All Rights Reserved Unless Otherwise Noted